package com.puman.watchtrade.util;

public class Save {
	
	public static void savePassWord(String account,String passWord){
		PropertiesConfig.getInstance("/sdcard/cross.xml").setProperty(
				account, passWord);		
	}
	
	public static String getPassWord(String account){	
		if(PropertiesConfig.getInstance("/sdcard/cross.xml")==null)
			return "";
		if (PropertiesConfig.getInstance("/sdcard/cross.xml").get(
				account) != null) {
			return PropertiesConfig.getInstance("/sdcard/cross.xml")
					.get(account).toString();
		} else {
			return "";
		}				
	}
	
	public static void saveAccount(String account,String num){
		PropertiesConfig.getInstance("/sdcard/cross.xml").setProperty(
				"account"+num, account);		
	}
	
	public static String getAccount(String num){	
		if(PropertiesConfig.getInstance("/sdcard/cross.xml")==null)
			return "0";
		if (PropertiesConfig.getInstance("/sdcard/cross.xml").get(
				"account"+num) != null) {
			return PropertiesConfig.getInstance("/sdcard/cross.xml")
					.get("account"+num).toString();
		} else {
			return "0";
		}				
	}
	
	
	public static void saveCountNum(String num){
		PropertiesConfig.getInstance("/sdcard/cross.xml").setProperty(
				"account_num", num);		
	}
	
	public static String getCountNum(){		
		if(PropertiesConfig.getInstance("/sdcard/cross.xml")==null)
			return "0";
		if (PropertiesConfig.getInstance("/sdcard/cross.xml").get(
				"account_num") != null) {
			return PropertiesConfig.getInstance("/sdcard/cross.xml")
					.get("account_num").toString();
		} else {
			return "0";
		}				
	}
	
	
}
